import datetime
from applications.extensions import db


class Share(db.Model):
    __tablename__ = 'blog_share'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment="资源ID")
    f_key = db.Column(db.String(16), comment="资源的key")
    icon = db.Column(db.String(8), comment="资源类型")
    name = db.Column(db.String(255), comment="资源名称")
    imgsrc = db.Column(db.String(255), comment="资源图片")
    weblink = db.Column(db.String(255), comment="资源链接")
    size = db.Column(db.Integer, comment="资源大小")
    date = db.Column(db.Integer, comment='时间戳')
    status = db.Column(db.Integer, comment="状态(1有效,0失效)")
    default_passcode = db.Column(db.String(255), comment="默认密码")
    parent_folder = db.Column(db.String(16), comment="父级文件夹")
    folder_path = db.Column(db.String(255), comment="文件路径")
    is_del = db.Column(db.Integer, comment="状态(1删除,0未删)")
    create_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_at = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')